﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>change</title>
</head>
<body>
<?php
    require "conn.php";

    $link = mysqli_connect(HOST,USER,PASS) or die("提示：数据库连接失败！");
    mysqli_select_db($link,DBNAME);
    mysqli_set_charset($link,'utf8');
    
    $ID = $_GET['ID'];
    $sql = mysqli_query($link,"SELECT * FROM `41812209` WHERE ID={$ID}");
    $sql_arr = mysqli_fetch_assoc($sql); 

?>

<form action="action_edit.php" method="post">
    <label>ID: </label><input type="text" name="ID" value="<?php echo $sql_arr['ID']?>">
    <label>姓名：</label><input type="text" name="name" value="<?php echo $sql_arr['name']?>">
    <label>性别：</label><input type="text" name="sex" value="<?php echo $sql_arr['sex']?>">
    <label>主修：</label><input type="text" name="major" value="<?php echo $sql_arr['major']?>">
    <input type="submit" value="提交">
</form>

</body>
</html>